package com.lnsf.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;



@Entity
@Table(name = "Users")
public class User {
	@TableGenerator(
		name = "userSeq",
		allocationSize = 1,
		initialValue = 1 ,
		pkColumnName = "Pk_name",
		pkColumnValue = "user_id",
		valueColumnName = "Pk_value"
	)
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="userSeq" )
	private Integer id ;
	
	@Column(nullable=false)
	private String username;
	
	@Column(nullable=false)
	private String password;
	
	@Column(nullable=false)
	private String phone;
	
	@Column(nullable=false)
	private String address;

	@Column(nullable=false)
	private Integer power;
	
	//邮箱
	private String email;
	
	//激活状态 1为激活， 0为未激活
	private Integer active;
	
	//邮箱验证码
	private String code;
	

	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Integer getActive() {
		return active;
	}
	public void setActive(Integer active) {
		this.active = active;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Integer getPower() {
		return power;
	}
	public void setPower(Integer power) {
		this.power = power;
	}
	
	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", phone=" + phone
				+ ", address=" + address + ", power=" + power + ", email=" + email + ", active=" + active + ", code="
				+ code + "]";
	}
	
	
	
	
	
	
	
	
}
